import { pubRequire } from '@utils/public'
const baseUrl = '/operation-advertising'
/*运营位列表*/
export function getBusinessManagementList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}

/* 新增运营位 */
export function addBusinessManagement(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
// 查询名称是否存在
export function getVerifications(location,name, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/verification/name-exists/?location=${location}&name=${name}`, '', callbBack, errBack)
}

// 编辑运营位
export function editBusinessManagement(id,obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callbBack, errBack)
}
//  运营位禁用
export function disableBusinessManagement(id, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/location/disable`, {}, callbBack, errBack)
}
//  运营位启用
export function enableBusinessManagement(id, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/location/enable`, {}, callbBack, errBack)
}

// 运营位排序
export function sortBusinessManagement(id,sort, callbBack, errBack) {
  return pubRequire('patch', `${baseUrl}/${id}/sort/${sort}`, {}, callbBack, errBack)
}
// 删除运营位
export function delBusinessManagement(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${obj.id}`, obj, callbBack, errBack)
}



